Skip to content

feat(nearai): add catalog sync module - #6776

Open
neo-sky wants to merge 2 commits into
anomalyco:devfrom
nearai:feat/nearai-sync
Open

neo-sky wants to merge 2 commits into
anomalyco:devfrom
nearai:feat/nearai-sync

Conversation

@neo-sky

@neo-sky neo-sky commented Sep 10, 2026

Copy link
Copy Markdown

Summary

Adds a nearai sync provider that reads the public /v1/models catalog on
cloud-api.near.ai. The endpoint needs no credential, so this needs no repository
secret and no change to sync-models.yml: the sync matrix is built from
bun models:sync --list-providers, so registering the provider is the wiring.

The provider creates, updates and removes, so providers/nearai tracks what the
host actually serves. This run adds 18 models, updates 1 and removes 1.

What the sync takes, and what it does not

The endpoint is authoritative for price and for catalog membership. Its other
fields are not, and each of these was checked against live requests rather than
read off the response. Prices come from
https://cloud-api.near.ai/v1/models, which publishes pricing.input and
pricing.output as dollars per million tokens and pricing.input_cache_read as
dollars per token, scaled here and rounded because the endpoint returns artifacts
such as 1.4000000000000001.

  • max_output_length is advisory and not enforced. On zai-org/GLM-5.1-FP8 it
    reports 16384, while max_tokens of 16384, 40000 and 131072 were all accepted
    and only 202752 and above were rejected, with "Requested token count exceeds the
    model's maximum context". The binding limit is the context window, so
    limit.output is never synced.
  • context_length is the serving max_model_len only where owned_by is
    nearai. On relayed routes it is rounded: openai/gpt-4.1 reports 1000000
    against the lab entry's 1047576. So context is synced for hosted models only,
    and taken as the lower of the two values. Created files inherit limits from the
    lab entry rather than taking them from the host, so a create never publishes a
    cap the lab does not carry.
  • supported_features is wrong in both directions. It lists reasoning for the
    Claude relay routes, where thinking.type and reasoning_effort are rejected
    and the accepted reasoning object returns no reasoning_content; it omits
    reasoning for others that plainly reason. No capability is taken from it.
  • input_modalities advertises image input for the Moonshot routes, which reject
    it, and for x-ai/grok-4.6, which fails the request outright. It also reports
    an embedding modality the schema has no value for.

How created models get their reasoning controls

/v1/models says whether a model reasons but not how a caller turns it on, off or
up, and the answer belongs to the route rather than the model, so the same lab
model is a toggle on one host and inert on another. Lab entries under models/
carry no reasoning_options, so it cannot be inherited either.

packages/core/src/sync/providers/nearai-curation.ts records that answer per
model, along with the evidence for it, and a model is created only once it has an
entry there. The evidence is written as the created file's leading comment, so
every toggle carries its wire path and every [] carries the measurement behind
it. [] here means the route was probed and exposes no caller control, never that
nobody looked: anthropic/claude-opus-5 accepts reasoning.effort and returns
identical completion_tokens ranges at every level across three samples, while
thinking.type and reasoning_effort are rejected outright. Effort levels are
recorded as a set and never as an ordering, because on deepseek-ai/DeepSeek-V4-Flash
high reasons least of the four.

The OpenAI routes pass reasoning_effort through to OpenAI, per
https://docs.near.ai/cloud/reasoning-models, and take their level set from the
matching providers/openai/models/ entry.

Every live model with no entry is held back and reported by name rather than
published with a guess, whether or not supported_features calls it a reasoner,
because that field omits reasoning for routes that plainly reason. One model is
currently held back: deepseek/deepseek-v4.1-flash.

gemini-3.8-flash is created with reasoning_options = [] on a live measurement:
reasoning_effort and reasoning.effort are both accepted, three samples per level
at temperature 0 leave the completion length inside the no-parameter spread, and no
reply carries reasoning_content. The five Gemini routes already published here are
left exactly as they are. They were never probed on this host, and the sibling
measurement is suggestive rather than conclusive, so this pull request does not
change them in either direction.

Why this carries 18 models, and what happens after it

This is the only pass that needs to be this size. classifyAutoMerge caps a sync
run at MAX_CREATED_MODELS = 10 and the backlog is 18, so the nightly
automation/sync-models-nearai run cannot land it however long it is left. The
first batch has to arrive in a reviewed pull request. After it the catalog is
level, and every later run is a delta of nought to two models.

From then on this runs on your infrastructure, with no credential of ours:

  • Price and context changes auto-merge, unbounded. A price-only update leaves
    reasoning, reasoning_options, interleaved and base_model untouched, so
    reasoningChanged is false and the reasoning check does not apply.
  • Models NEAR AI stops serving are removed, up to ten a night.
  • A new model waits until someone probes how its reasoning is controlled and
    records it, because the sync refuses to guess.

One gap is worth naming rather than leaving to be discovered. A newly created
reasoning model is unsafe to auto-merge unless its provider is listed in
REVIEWED_REASONING_PROVIDERS, and nearai is not, so a new model would open a
sync pull request and then wait for a human even once its controls are recorded.
Adding nearai to that set would close it, and we are glad to do that here or
leave it alone, whichever you prefer. The case for it is that this provider cannot
create a reasoning model with guessed controls, because translateModel throws
unless the model has a curation entry, so anything it creates carries measured
reasoning_options and the measurement is in the file. The case against is that it
is your trust list rather than ours, and everything else here works without it.

Safety

  • The fetch refuses a response carrying fewer than 20 models. Absence now removes a
    model, and a truncated list that still parses would otherwise be
    indistinguishable from a mass retirement. The live list carried 52 models when
    this was written.
  • trackMissingModels: false: remote-only models are listed in the sync notice
    rather than filed as one issue each.
  • An entry whose local cost does not resolve is skipped into the notice instead of
    aborting the run for every other model.
  • Curation is read only when a file is created. After that the file in this
    repository is the record and corrections are reviewed here.

Entries created here publish the inputs the route accepts rather than the lab's
superset. A type: "file" content part fails schema deserialisation on every
route, so no entry this pull request adds lists pdf, and none inherits video
or audio the endpoint does not report. Fifteen entries already published under
providers/nearai still inherit those modalities from their lab entries.
Narrowing them touches files this change does not otherwise go near, so it is
left out rather than folded in.

The one removal

zai-org/GLM-5.1-FP8 is removed. It has been absent from /v1/models since
2026-09-11, when its production completion endpoint was retired. The curation file
records that removal as deliberate so a later run does not read it as a gap.

One thing worth knowing about the model IDs

NEAR AI spells the same lab both ways: Qwen/Qwen3.8-27B alongside
qwen/qwen3.7-max. Since the filename is the model ID and the ID has to match
what the host accepts, providers/nearai/models now holds both a Qwen and a
qwen directory. Those are distinct paths in git but the same directory on a
case-insensitive filesystem, where a tree walk would attribute a file to whichever
spelling was created first. Renaming either one would publish an ID the host does
not serve, so the casing follows the host. Flagging it because it is the only such
pair in the repository.

Checks

  • bun validate - exit 0
  • bun install && bun validate && bun run test in packages/sdk, matching
    validate.yml - 23 passed, typecheck clean
  • bun test packages/core/test/nearai.test.ts - 26 passed
  • bun models:sync nearai --dry-run - 18 created, 1 updated, 1 removed,
    30 unchanged
  • bun models:sync nearai run twice - the second run reports 0 created, 0 updated,
    0 removed, 49 unchanged
  • full bun test - the same 4 unrelated failures reproduce on a clean dev
    checkout at 76571c179

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/anthropic/claude-haiku-4-5.toml:2 - Check: Relay reasoning_options must match this host’s real controls (and stay consistent with sibling NEAR Claude routes). Why: These files still declare toggle + budget_tokens (opus-4-7: toggle only), while the PR’s own live probes set Fable/Opus 4.8/Opus 5/Sonnet 5 to [] because the gateway rejects or ignores reasoning params and returns no reasoning_content. The PR body also states Claude relay routes accept reasoning params but return no reasoning content. Publishing budget/toggle here misleads clients into sending Anthropic-style controls this OpenAI-compatible surface does not honor. Same issue on claude-opus-4-6.toml, claude-opus-4-7.toml, claude-sonnet-4-5.toml, claude-sonnet-4-6.toml. Action: Re-probe these five routes the same way as the new Claude entries; set reasoning_options = [] with a leading evidence comment if controls are inert, or author only the wire controls that actually change reasoning output—and drop unsupported budget_tokens if that field is not enforced.
  • [high] [violation] providers/nearai/models/google/gemini-3.8-flash.toml:2 - Check: On relays, [] means affirmative no caller control, not uncertainty; baseline is lab/same-surface peers. Why: New entry sets reasoning_options = [] with no probe comment, while first-party providers/google/models/gemini-3.8-flash.toml and OpenRouter peers expose effort low/medium/high. Empty options on a controlled reasoner without host-specific evidence is a policy violation. Action: Verify whether NEAR accepts Gemini reasoning/effort (or equivalent) on this route; copy the working control set, or keep [] only with a leading comment documenting the failed control probes.
  • [medium] [violation] providers/nearai/models/anthropic/claude-haiku-4-5.toml:2 - Check: Every toggle needs a leading top-of-file wire-path comment. Why: These Claude 4.x files were reformatted in this PR and still ship { type = "toggle" } with no leading # Toggle: … comment (required because sync strips mid-file comments). Applies to the same five Claude 4.x files while they retain a toggle. Action: If any toggle remains after the control audit above, add a leading comment with the exact request field/path; if options become [], the comment requirement no longer applies.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/anthropic/claude-haiku-4-5.toml:1 - Check: Provider modality overrides must match this host’s real input surface. Why: The PR states the gateway cannot accept PDF in any form (and that video/audio were never verified), and the new Claude / Gemini / Qwen entries correctly override [modalities].input. Existing base_model files with no modality override still inherit lab pdf (and Gemini still inherits video/audio/pdf), so resolved nearai models keep advertising unsupported inputs. Action: Add host-true [modalities].input (and attachment when that becomes text-only) on every nearai base_model entry that would otherwise inherit PDF/video/audio—at least the Claude 4.x, GPT, and Gemini files left without overrides.
  • [high] [possible mistake] providers/nearai/models/anthropic/claude-sonnet-4-5.toml:2 - Check: reasoning_options must describe effective caller controls on this host. Why: The PR body says Claude relay routes accept documented reasoning parameters but return no reasoning_content, and the new Claude 5.x/Fable/Opus 4.8 entries correctly use reasoning_options = [] after live probes. Claude 4.x still publish toggle + budget_tokens (and Opus 4.7 toggle only) with no wire-path comment, which conflicts with that same-host evidence and will steer clients toward ineffective or invalid controls. Action: Live-probe the Claude 4.x routes the same way as Claude 5.x; set reasoning_options = [] with a leading no-control comment if they match, or keep real controls only with a leading wire-path comment and host-specific evidence that they differ from the new Claude routes.
  • [medium] [violation] providers/nearai/models/Qwen/Qwen3-VL-30B-A3B-Instruct.toml:1 - Check: Non-lab hosts must use base_model for nameable lab models. Why: This PR converts peers such as GLM-5.1-FP8 to override-only base_model files and claims base_model-only authoring, but the refreshed Qwen3-VL TEE entry remains a full third-party inline definition for a nameable Alibaba model with no models/alibaba/… target. Action: Add a complete models/alibaba/… lab entry for Qwen3-VL 30B-A3B Instruct (or the correct lab id), then rewrite the nearai file as base_model + host deltas only (cost, TEE name/dates, served limit, modalities).

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/google/gemini-2.5-flash-lite.toml:1 - Check: Relay reasoning_options must be the intersection this host actually exposes; every toggle needs a leading wire-path comment; budget_tokens only when this host has a real reasoning-budget field. Why: Patch 11 copies first-party Google toggle + budget_tokens (and Pro’s budget bounds) onto the NEAR AI Gemini 2.5 routes while the headers say the wire path was not probed. That invents lab budget controls on an unverified openai-compatible relay (and leaves toggles without a wire comment). Same-surface Claude probes on this gateway already showed native thinking/effort parameters are rejected. Action: For gemini-2.5-flash-lite, gemini-2.5-flash, and gemini-2.5-pro, either live-verify the exact request fields and keep only supported controls (with a leading # Toggle: … / # Budget: … wire comment), or set reasoning_options = [] with affirmative no-control evidence—do not paste lab budget/toggle shapes untested.
  • [medium] [violation] providers/nearai/models/google/gemini-2.5-flash-lite.toml:12 - Check: Provider cost keys must match served modalities (no priced audio when audio input is not offered). Why: These routes now override modalities to text-only or text+image (no audio), but still author input_audio. The PR already dropped input_audio on gemini-3.8-flash for that reason; leaving it on the 2.5 / 3.1 / 3.5 entries publishes a non-usable audio price. Action: Remove input_audio from gemini-2.5-flash-lite, gemini-2.5-flash, gemini-3.1-flash-lite, and gemini-3.5-flash unless audio input is restored and verified on this host.
  • [medium] [possible mistake] providers/nearai/models/openai/gpt-5.toml:1 - Check: Host-true modality / attachment overrides should be applied consistently across the same gateway surface. Why: Patch 11 marks several OpenAI routes text-only (attachment = false, input = ["text"]) while siblings that still inherit lab image/pdf stay unchanged (gpt-5, gpt-5.2, gpt-4.1-nano, o4-mini) and newer GPT-5.6/GPT-6 entries keep explicit text+image. If the text-only findings are host-wide for that generation, unresolved files will keep advertising image input incorrectly. Action: State which OpenAI routes were image-probed and align the remaining entries (including gpt-5, gpt-5.2, gpt-4.1-nano, o4-mini, and the GPT-5.6/GPT-6 files) to the same verified modality set, or restore image where the probe showed it works.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/google/gemini-2.5-flash.toml:1 - Check: Reasoning options must match this host’s OpenAI-compatible surface (lab + same-surface peers), not another API’s wire path. Why: NEAR AI is @ai-sdk/openai-compatible (cloud-api.near.ai/v1). The PR authors Gemini 2.5 Flash / Flash-Lite / Pro with Google-native generationConfig.thinkingConfig.thinkingBudget comments and first-party budget_tokens (plus toggle). Same-surface OpenAI-compat peers such as OpenRouter expose toggle-only for Flash/Flash-Lite (no budget). Documenting a Google AI Studio/Vertex path clients cannot send on this gateway, and inventing budget controls that peers on the same kind of surface do not publish, misleads callers and breaks the host-role rule in AGENTS.md / the audit skill. The PR itself states these Google paths were not probed. Action: Drop Google-native generationConfig… wire comments. Re-author reasoning_options from a live probe of POST /v1/chat/completions on this host, or from verified openai-compat peers of the same models (e.g. OpenRouter toggle-only for 2.5 Flash/Lite). Only keep budget_tokens if this gateway actually accepts a reasoning-budget field and document that wire path in a leading comment.
  • [high] [violation] providers/nearai/models/google/gemini-2.5-flash-lite.toml:1 - Check: Same host-surface / peer baseline rule for Gemini 2.5 Flash-Lite. Why: Same incorrect generationConfig.thinkingConfig.thinkingBudget toggle+budget packaging as Flash, with no host probe. Action: Align with the corrected Flash treatment (probe or openai-compat peers; no Google Messages/generationConfig path).
  • [high] [violation] providers/nearai/models/google/gemini-2.5-pro.toml:1 - Check: Same rule for Gemini 2.5 Pro. Why: Authors budget_tokens with a Google-native wire comment and no probe on this host. Even if some relays expose a budget for Pro, the comment must name NEAR’s request field, not generationConfig.thinkingConfig.thinkingBudget. Action: Probe or cite the actual NEAR request syntax; keep budget only if it works here; fix the leading wire comment accordingly.
  • [medium] [possible mistake] providers/nearai/provider.toml:6 - Check: Provider docs must not contradict the catalog’s host-true reasoning behavior. Why: The header still says third-party routes “pass through their provider-native reasoning controls,” but this PR sets every Anthropic route to reasoning_options = [] (no caller control) and documents that Claude relays reject native thinking/reasoning_effort. That stale claim will send integrators down the wrong path. Action: Rewrite the provider.toml reasoning notes so they match the final catalog (hosted TEE toggles vs OpenAI effort vs Anthropic no-control vs Google only where verified).
  • [low] [possible mistake] providers/nearai/models/deepseek-ai/DeepSeek-V4-Flash.toml - Check: Relay effort set should be the intersection of lab/peers and what this host exposes. Why: First-party DeepSeek and OpenRouter peers for V4 Flash publish toggle + graded effort (high/max or low/high/max). This entry is toggle-only after verifying chat_template_kwargs.thinking. That is valid if effort is truly ignored, but the PR does not record an effort probe the way it does for Anthropic rejections. Action: Confirm whether reasoning_effort (or equivalent) has effect on this route; if yes, add the real effort values and a leading effort wire comment; if no, add a short header note that effort was tested and ignored so the narrower set is intentional.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] providers/nearai/models/Qwen/Qwen3.6-35B-A3B-FP8.toml:20 - Check: Host limit.output must be a real serving delta, not the catalog’s advisory max_output_length. Why: This entry still forces output = 32_768 while the lab base is 65_536, and the PR/sync policy states max_output_length is not enforced (only context binds). That understates the host’s usable output unless separately verified. Action: Drop the output override to inherit the lab limit, or keep it only with a leading comment citing a live max-token acceptance/rejection result on this route.
  • [medium] [possible mistake] providers/nearai/models/Qwen/Qwen3-VL-30B-A3B-Instruct.toml:16 - Check: Same output-limit evidence standard as above. Why: Context 16_384 is documented from the TEE max_model_len, but output = 8_192 remains while the new lab entry is 32_768, with no probe showing 8192 is binding on this host. Action: Remove the unproven output cap (inherit 32_768) or document a verified host output ceiling.
  • [medium] [possible mistake] providers/nearai/models/google/gemini-3.1-flash-lite.toml:3 - Check: Relay reasoning controls should match this host’s openai-compatible surface and same-surface peers. Why: Final options are effort-only minimal|low|medium|high. OpenRouter’s peer for the same model exposes toggle + that effort set, and this PR already established that NEAR accepts the openai-compatible reasoning object (used as toggle on Gemini 2.5). Omitting toggle may under-report a working off control. Action: Probe reasoning.enabled on this route; add { type = "toggle" } plus a leading wire comment if it works, or document why 3.1-flash-lite cannot be toggled here while 2.5 can.
  • [low] [possible mistake] providers/nearai/models/anthropic/claude-fable-5.toml:8 - Check: Provider cost completeness vs sibling NEAR AI Anthropic routes. Why: New Anthropic relays (claude-fable-5, claude-fable-5-1, claude-opus-4-8, claude-opus-5, claude-sonnet-5) publish cache_read only. Existing NEAR AI Claude 4.x entries and first-party/OpenRouter peers also publish cache_write. If this gateway bills cache writes, these prices are incomplete. Action: Confirm against the NEAR catalog/docs whether cache write is charged on these IDs; add cache_write where it applies (or note in a leading comment if the host truly has no write price).

@neo-sky neo-sky changed the title feat(nearai): add catalog sync and refresh model entries feat(nearai): add catalog sync module Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] .pr-review/diff.patch:3915 - Check: PR delivers the catalog refresh it claims (AGENTS.md contribution completeness; title/body vs final tree). Why: Title and body say the PR refreshes NEAR AI model entries, adds models/alibaba/qwen3-vl-30b-a3b-instruct.toml, converts GLM-5.1 to base_model, and applies live-probed pricing/limits/modalities/reasoning. Patch 14/14 deletes those new models and lab metadata and restores the prior provider TOMLs, so the final tree is sync infrastructure only and contradicts the PR’s own probe notes. Action: Restore the catalog refresh (new routes, lab base_model targets, pricing/limit/modality/reasoning fixes) consistent with the PR evidence, or drop the refresh claims and retitle/redescribe this as sync-only.
  • [medium] [possible mistake] packages/core/src/sync/providers/nearai.ts (hosted owned_by === "nearai" context gate) - Check: Hosted-model context sync only when the gateway actually marks NEAR-hosted routes that way. Why: Context is updated only for owned_by = "nearai", but the unit fixture for the TEE id zai-org/GLM-5.1-FP8 uses owned_by: "zai-org". If live catalog rows for NEAR-hosted models use org owners rather than "nearai", hosted context_length never syncs and stays stale. Action: Confirm live owned_by for NEAR-hosted/TEE models; broaden the hosted predicate (or map known hosted ids) so context sync matches real catalog ownership.

@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added reviewer: ready Automated review found no actionable items and removed reviewer: ready Automated review found no actionable items labels Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added reviewer: ready Automated review found no actionable items and removed reviewer: ready Automated review found no actionable items labels Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added reviewer: ready Automated review found no actionable items and removed reviewer: ready Automated review found no actionable items labels Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] packages/core/src/sync/index.ts:222 - Check: Registering a sync provider must not remove other providers from groups.direct. Why: The PR replaces the entire direct group array with a stale list that omits fireworks-ai, friendli, and ollama-cloud (present on current dev) while inserting nearai. That would drop those providers from bun models:sync direct and any tooling that uses the group. Check packages/core/src/sync/index.ts on dev and Action: add only "nearai" to the current direct membership; do not rewrite the array from an older snapshot.

@github-actions github-actions Bot added reviewer: ready Automated review found no actionable items and removed reviewer: ready Automated review found no actionable items labels Sep 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/anthropic/claude-haiku-4-5.toml:2 - Check: Relay reasoning_options must match this host’s real control surface (AGENTS.md Reasoning options). Why: The PR’s own live probes (and the new Claude 5.x entries) show every Anthropic route on NEAR AI rejects thinking.type / reasoning_effort and returns no reasoning_content, yet these existing routes still publish toggle + budget_tokens (and claude-opus-4-7 still publishes toggle). Clients will send parameters this gateway rejects. Action: Set reasoning_options = [] on claude-haiku-4-5, claude-opus-4-6, claude-opus-4-7, claude-sonnet-4-5, and claude-sonnet-4-6, with the same leading no-control evidence used on the Claude 5.x files; drop invented budget_tokens.
  • [high] [violation] providers/nearai/models/google/gemini-2.5-flash.toml:2 - Check: On relays, [] means affirmative no caller control, not uncertainty or unprobed lab defaults. Why: These reasoners keep reasoning_options = [] (and input_audio without a verified audio modality) while same-surface OpenAI-compatible peers expose real controls, and earlier commits in this PR already documented that this gateway accepts the reasoning object on Gemini routes. That is the anti-pattern AGENTS.md forbids. Action: For gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3.1-flash-lite, and gemini-3.5-flash, publish the host-true reasoning controls (or re-probe and document affirmative inertness), add required toggle wire comments, drop unverified input_audio, and narrow modalities only where verified.
  • [high] [violation] providers/nearai/models/Qwen/Qwen3.8-27B.toml:4 - Check: Provider modality overrides must not inherit lab inputs the host rejects or never verified. Why: Creates omit modalities while lab bases include video / pdf / audio (alibaba/qwen3.8-27b, zhipuai/glm-5.3-flash, and several Claude/OpenAI labs with pdf). The PR’s own probes say PDF fails schema deserialization on every route and video/audio were never verified, so resolved catalog entries will advertise false inputs. Action: On create and in nearai-curation.ts, always author the verified input set (at least drop pdf; keep video/audio only when probed), matching the Claude/Moonshot/Gemini 3.8 pattern.
  • [high] [violation] providers/nearai/models/Qwen/Qwen3-VL-30B-A3B-Instruct.toml:1 - Check: Non-lab hosts must use base_model with a complete lab entry when the lab model is nameable. Why: This stays a full inline third-party definition of a Qwen VL model. The PR briefly added models/alibaba/qwen3-vl-30b-a3b-instruct.toml then deleted it, leaving the host file non-compliant. Action: Restore a complete lab metadata file and convert this provider entry to override-only (base_model, cost, real limit deltas).
  • [high] [possible mistake] providers/nearai/models/Qwen/Qwen3.6-35B-A3B-FP8.toml:13 - Check: Host modality and reasoning side-channel claims must match the PR’s live probes. Why: Patch evidence in this PR shows the route correctly reads images and returns reasoning_content under enable_thinking, but the final file is text-only, drops [interleaved], and has a toggle with no leading wire-path comment. Action: Restore verified input = ["text", "image"] (and attachment if needed), restore interleaved.field = "reasoning_content", and add the required top-of-file toggle comment.
  • [medium] [possible mistake] providers/nearai/models/zai-org/GLM-5.1-FP8.toml - Check: Authoritative create/delete must not drop a still-served hosted model without a safe recreate path. Why: The file is deleted and there is no nearai-curation entry. labModelID("zai-org/GLM-5.1-FP8") would resolve to a non-existent zai-org/glm-5.1-fp8 lab id (the real base is zhipuai/glm-5.1), so a live catalog row cannot be recreated cleanly. Action: If the route is still on /v1/models, keep/recreate it with base_model = "zhipuai/glm-5.1", curated reasoning/interleaved, and hosted context; if it is gone, document that in curation as an intentional skip/removal.
  • [medium] [violation] packages/core/src/sync/providers/nearai.ts (createNearAIModel) - Check: Hosted-model context is API-authoritative and must not wait for a later update pass. Why: Creates write only cost + curation overrides and inherit lab limit.context. For owned_by = "nearai" routes the PR correctly treats context_length as serving max_model_len, so first-time creates (e.g. TEE hosts) can publish a lab window wider than the host until a second sync. Action: On create, when owned_by === "nearai", set limit.context from atMost(lab, context_length) the same way updates do.
  • [low] [possible mistake] .pr-review/pull-request.json (PR body) - Check: Data-changing PRs should describe what actually lands. Why: The body still says this is sync-only and never creates or deletes model files, but the final change set creates many routes, deletes GLM-5.1-FP8, and enables delete-missing. Action: Update the PR summary to match create/delete behavior, curation gating, and the pricing/probe sources for the new model rows.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/Qwen/Qwen3-VL-30B-A3B-Instruct.toml:1 - Check: Non-lab hosts must use base_model with a complete models/<lab>/ entry when the lab model is nameable. Why: This stays a full inline third-party definition for Qwen’s VL instruct weights. An earlier revision added models/alibaba/qwen3-vl-30b-a3b-instruct.toml and factored the host file, then both were dropped, so the catalog still ships a host-local copy of lab facts. Action: Restore a complete lab file under models/alibaba/ and convert this provider entry to override-only (base_model, cost, and any real NEAR-serving deltas such as the 16 384 context cap).
  • [high] [violation] providers/nearai/models/Qwen/Qwen3.6-35B-A3B-FP8.toml:2 - Check: Every toggle needs a leading top-of-file wire-path comment. Why: The file publishes reasoning_options = [{ type = "toggle" }] with no leading comment naming the request field. Sync can strip mid-file comments, so callers cannot tell how to turn thinking on/off on this host. Action: Add a leading header such as # Toggle: chat_template_kwargs.enable_thinking = true|false (matching the other NEAR Qwen/GLM routes).
  • [high] [violation] providers/nearai/models/anthropic/claude-haiku-4-5.toml:2 - Check: Every toggle needs a leading top-of-file wire-path comment. Why: claude-haiku-4-5, claude-opus-4-6, claude-sonnet-4-5, and claude-sonnet-4-6 still ship toggle (+ budget_tokens) with no wire comment, while the curation notes claim thinking = {type: "enabled", budget_tokens: N} is the accepted surface on those routes. Action: Add the same leading wire comment on each of those four files (and keep the comment above the first key so sync does not drop it).
  • [high] [possible mistake] providers/nearai/models/Qwen/Qwen3.6-35B-A3B-FP8.toml:13 - Check: Host modality/attachment claims must match live route behavior and stay consistent after merge. Why: This PR’s own image-probe notes say Qwen3.6-35B-A3B-FP8 correctly read a two-colour test image, yet the final file forces input = ["text"] and does not set attachment = false, so it both under-reports image support and still inherits lab attachment = true. Sibling Qwen creates (Qwen3.8-27B, qwen3.5-397b-a17b) publish text+image. Action: Reconcile with the probe: either set input = ["text", "image"] (and drop a redundant attachment override), or if the route is truly text-only keep text-only and set attachment = false, with a short leading note of the evidence.
  • [high] [possible mistake] providers/nearai/models/google/gemini-2.5-flash.toml:2 - Check: On relays, reasoning_options = [] means affirmative no caller control, not uncertainty; baseline is lab + same-surface peers. Why: First-party Google entries expose real controls (toggle/budget_tokens or effort), and an earlier revision of this PR documented that this gateway accepted the OpenAI-compatible reasoning object on Gemini routes. The final files still stamp [] on gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3.1-flash-lite, and gemini-3.5-flash without the per-route no-op evidence used for gemini-3.8-flash. Action: For each of those five routes, either publish the host-true control set with a wire comment (as done for 3.8-flash’s empty set), or add leading probe evidence that every accepted control is a no-op and keep [].
  • [medium] [violation] packages/core/src/sync/providers/nearai.ts (translateModel unpriced branch) - Check: With default deletion enabled, returning undefined for a still-served local ID removes that model. Why: if (existing.cost === undefined) return undefined treats an unpriced-but-present entry as absent. The runner will then delete the TOML on the next sync, despite the comment claiming the model is only skipped into the notice. Action: Preserve still-served unpriced locals (for example via missingModelID / equivalent retain path) and only return undefined for intentional creates/skips, matching other providers that document this delete-on-skip hazard.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/google/gemini-2.5-flash.toml:2 - Check: On multi-model relays, reasoning = true must use lab/same-surface peer controls; [] only with affirmative evidence of no caller control (AGENTS.md Reasoning options; audit skill). Why: Final files keep reasoning_options = [] for gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3.1-flash-lite, and gemini-3.5-flash. Lab/peers expose real controls (e.g. Google 2.5 toggle+budget, 3.x effort). Earlier commits briefly set those, then patch 14 restored empty arrays with no host probe that effort/toggle is absent. By contrast gemini-3.8-flash correctly documents a no-op probe before []. Action: For each of the five routes, either restore lab/peer-shaped options with a leading wire-path comment for this gateway, or keep [] only after live probes show the same no-control result as 3.8-flash and document that evidence in the file header.
  • [medium] [violation] packages/core/src/sync/providers/nearai.ts (createNearAIModel) - Check: Uncurated live reasoners must be held back loudly, not dropped silently (sync.md NEAR AI notes; PR design). Why: When curation is missing, create only throws MissingReasoningOptionsError if supported_features includes "reasoning". The same module and PR body treat that field as unreliable both ways (omits reasoners that plainly reason). Those IDs then return undefined, land in the soft skip notice, and never force a curation entry. Action: Decide presence of caller-side reasoning from resolved lab base_model reasoning (or always require curation for new IDs), not from supported_features; keep intentional non-chat skips only via skip: true.
  • [low] [possible mistake] packages/core/src/sync/providers/nearai.ts (skippedNotice) - Check: Skip notices should match actual skip paths. Why: Notice text still cites local entries that “resolve to no cost,” but the unpriced path now returns the authored file unchanged so it is not skipped/deleted. Action: Drop the obsolete “no cost” clause (and any related test expectations) so the notice only covers curation gaps and deliberate skip holds.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/google/gemini-3.1-flash-lite.toml:1 / providers/nearai/models/google/gemini-3.5-flash.toml:1 - Check: Relay reasoning_options must match this host’s controls, not lab/peer enums alone (AGENTS.md Reasoning options; audit skill evidence bar). Why: These files publish effort (minimal/low/medium/high) from lab/peer copy with no live NEAR AI probe. On the same gateway, gemini-3.8-flash was probed and set to [] because reasoning_effort / reasoning.effort are accepted no-ops. Publishing graded effort for 3.1/3.5 will make clients send parameters that this host has already shown do nothing on a sibling Gemini route. Action: Probe 3.1 and 3.5 the same way as 3.8 (and 2.5). If effort is inert, set reasoning_options = [] with a leading evidence comment; only keep effort if this host changes reasoning behavior.
  • [high] [violation] providers/nearai/models/anthropic/claude-haiku-4-5.toml:1 (and claude-opus-4-6, claude-sonnet-4-5, claude-sonnet-4-6) - Check: Provider overlays must override modalities that this host does not accept; do not inherit false lab inputs. Why: New Anthropic routes correctly set modalities.input = ["text", "image"] because type: "file" fails schema deserialisation on every route. These older Claude 4.x entries still inherit lab pdf, so the catalog advertises PDF attachments the gateway rejects. The same gap applies to any other pre-existing NEAR AI overlay that inherits lab pdf/video/audio without a host override. Action: Add the same text/image (or verified) modality overrides—and attachment where needed—on every existing NEAR AI route covered by that “file fails everywhere” evidence, not only on newly created files.
  • [medium] [possible mistake] providers/nearai/models/google/gemini-2.5-flash.toml:1 / gemini-2.5-flash-lite.toml:1 / gemini-2.5-pro.toml:1 - Check: Toggle/budget must be host-true with meaningful effect, not mere HTTP acceptance. Why: Headers claim 2026-09-08 probes accepted the OpenAI-compatible reasoning object and copy OpenRouter shapes (toggle, budget_tokens 128–32768). Gemini 3.8 on this host accepted effort with no effect. If 2.5 was only checked for acceptance (not reasoning_tokens / behavior deltas), clients get fake controls. Action: Confirm toggle/reasoning.max_tokens change reasoning behavior on this gateway; if not, set [] (or the real host set) with evidence, consistent with the 3.8 standard.
  • [low] [possible mistake] providers/nearai/provider.toml:6 - Check: Provider docs should match the authored control surface. Why: Comment still says third-party routes “pass through their provider-native reasoning controls,” but this PR documents Anthropic routes with no caller control and Gemini/OpenAI-compat reasoning.* / reasoning_effort behavior instead. Action: Update the comment to the host-true split (hosted chat_template_kwargs.*, OpenAI-style relays, Anthropic no-op/reject) so it does not contradict the model headers and sync.md.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/anthropic/claude-opus-4-7.toml:2 - Check: reasoning_options must match this host’s real API (AGENTS.md / audit skill: no invented controls; [] only with affirmative no-control evidence). Why: This PR’s own live probes (and the sibling Claude 4.8/5/Fable/Sonnet 5 entries) show thinking.type and reasoning_effort are refused on routes from Opus 4.7 upward, with no usable caller control. The final commit still publishes reasoning_options = [{ type = "toggle" }], which will make clients send a parameter this gateway rejects. Action: Set reasoning_options = [] and restore a leading comment documenting the refused wire paths (same pattern as the new Claude routes).
  • [high] [violation] providers/nearai/models/google/gemini-2.5-flash.toml:2 - Check: On relays, do not author [] when this host was shown to expose a control, or when lab/same-surface peers expose controls and uncertainty is not an excuse. Why: Intermediate commits in this PR recorded live 2026-09-08 probes: the gateway accepts the OpenAI-compatible reasoning object (reasoning.enabled / reasoning.max_tokens) while rejecting thinking.type and reasoning_effort, and briefly authored toggle/budget/effort to match OpenRouter peers. The final commit restores bare [] on gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3.1-flash-lite, and gemini-3.5-flash, which catalogs “no caller control” against that evidence and against first-party/OpenRouter peers. Action: Restore host-true reasoning_options plus leading wire-path comments from the probe (toggle-only for 2.5 Flash/Lite; budget for 2.5 Pro; effort sets for 3.1/3.5), or re-probe and document affirmative no-ops before keeping [].
  • [medium] [violation] providers/nearai/models/Qwen/Qwen3.6-35B-A3B-FP8.toml:2 - Check: Every toggle needs a leading top-of-file wire-path comment; provider files should not omit host deltas already established for the same TEE surface. Why: Final state keeps reasoning_options = [{ type = "toggle" }] with no # Toggle: … header, no [interleaved], and input = ["text"], while the new sibling Qwen/Qwen3.8-27B on the same host documents chat_template_kwargs.enable_thinking, sets interleaved.field = "reasoning_content", and publishes text+image from live probes. Callers lose the wire path and may mis-handle reasoning/attachments on this route. Action: Align with the probed Qwen TEE pattern: leading toggle comment, interleaved, and modalities/attachment that match live behavior (not the unprobed lab video/audio set).
  • [medium] [possible mistake] packages/core/src/sync/providers/nearai.ts (createNearAIModel) - Check: Hosted NEAR AI routes (owned_by = "nearai") should not first-publish a lab context wider than the serving max_model_len. Why: Updates cap context with atMost(local, context_length) only for hosted models, but creates write no [limit] and inherit the full lab window. New hosted files such as Qwen/Qwen3.8-27B and deepseek-ai/DeepSeek-V4-Flash therefore ship lab contexts until a later update pass, which can overstate what the TEE actually serves (the PR already special-cased Qwen3-VL at 16_384 for this reason). Action: On create for owned_by = "nearai", write limit.context as the API context_length (still omit advisory max_output_length), or run a follow-up update in the same sync so the committed files include the serving cap.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/google/gemini-3.1-flash-lite.toml:4 - Check: Relay reasoning_options must match this host’s real control surface, not lab/peer defaults when same-host evidence contradicts them. Why: These files publish effort minimal|low|medium|high solely because first-party/OpenRouter peers list that set, while the PR’s own live probes on the same gateway for gemini-3.8-flash show reasoning_effort / reasoning.effort accepted but inert and correctly author []. Publishing graded effort here will make clients send parameters this OpenAI-compatible Gemini surface may ignore. Action: Probe gemini-3.1-flash-lite and gemini-3.5-flash the same way as gemini-3.8-flash; set [] (with evidence header) if effort is a no-op, or keep effort only with host evidence of a real wire effect.
  • [high] [violation] providers/nearai/models/google/gemini-3.5-flash.toml:4 - Check: Same host-true reasoning baseline as above. Why: Same unprobed peer-copied effort set on a Gemini route that shares the surface where sibling gemini-3.8-flash was measured as control-less. Action: Align with host probes; do not copy Google/OpenRouter effort lists without NEAR AI effect evidence.
  • [high] [violation] providers/nearai/models/anthropic/claude-haiku-4-5.toml:7 - Check: Provider modality overrides must reflect what this host accepts; drop lab pdf when the gateway rejects it. Why: New Claude routes and curation evidence state that a type: "file" part fails schema deserialisation on every route, and those creates correctly set modalities.input = ["text", "image"]. These older Claude 4.5/4.6 overlays still inherit lab pdf (and the same applies to claude-opus-4-6, claude-sonnet-4-5, claude-sonnet-4-6). Action: Add modalities.input = ["text", "image"] (and matching evidence comments) on all Claude routes that still inherit pdf.
  • [medium] [possible mistake] providers/nearai/models/google/gemini-2.5-flash.toml:5 - Check: Toggle/budget_tokens require affirmative host effect, not mere HTTP acceptance. Why: Headers claim the OpenAI-compatible reasoning object was accepted on 2026-09-08, but the same PR shows acceptance without effect on other NEAR AI Gemini routes (gemini-3.8-flash). gemini-2.5-flash / gemini-2.5-flash-lite toggle and gemini-2.5-pro budget_tokens may therefore overstate caller control. Action: Confirm reasoning.enabled / reasoning.max_tokens change reasoning behavior (e.g. reasoning_tokens or equivalent); if accepted-but-inert, use [] and document that, matching the 3.8 finding.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/nearai/models/google/gemini-2.5-flash.toml:2 - Check: Relay reasoning = true models must not use reasoning_options = [] when the lab and same-surface peers expose caller controls. Why: Final files for gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3.1-flash-lite, and gemini-3.5-flash all publish []. First-party/OpenRouter peers use toggle and/or budget_tokens (2.5) or effort minimal|low|medium|high (3.x). Empty means affirmative no control, not “left as on dev.” This PR itself restored host-probed controls (reasoning.enabled toggle, reasoning.max_tokens budget, lab effort sets) and then dropped them again in the last commit. Action: Restore host-true options (or add leading comments with live proof that every peer control is rejected/inert on this gateway), matching lab/OpenRouter baselines where the route actually forwards them.
  • [high] [violation] providers/nearai/models/google/gemini-2.5-flash.toml:4 - Check: Provider modality overrides must not advertise inputs the host rejects; pdf stripping must be complete when claimed. Why: Patch 22’s rationale is that a type: "file" part fails schema deserialisation on every route, and Anthropic/OpenAI pdf-bearing labs were narrowed to ["text", "image"]. These Gemini entries still inherit lab input including pdf (and video/audio), and still publish input_audio, while gemini-3.8-flash was correctly narrowed to text+image. Clients will send attachments/audio the gateway cannot take. Action: Override [modalities].input (and attachment / input_audio as needed) on every Gemini nearai route to the live-accepted set, consistent with the pdf probe and the 3.8-flash treatment.
  • [medium] [possible mistake] providers/nearai/models/Qwen/Qwen3.6-35B-A3B-FP8.toml:1 - Check: Every toggle needs a leading top-of-file wire-path comment; TEE/host deltas should stay override-only and complete. Why: Intermediate commits authored # Toggle: chat_template_kwargs.enable_thinking…, [interleaved], TEE naming, and input = ["text", "image"]. The final tree still has a bare toggle with no wire comment and a text-only modality override against a multimodal lab entry, so a later sync rewrite will not reintroduce the probe evidence. Action: Restore the toggle wire comment (and interleaved/TEE/modality overrides if those remain host-true) so the file matches the probed TEE surface.

Reads the public /v1/models catalog, syncing price and hosted-model context. Creates and removes models, with nearai-curation.ts recording how each route controls reasoning and holding back anything it has no entry for.
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Sep 16, 2026
Adds the eighteen models NEAR AI serves that models.dev did not carry, removes GLM-5.1 after its 2026-09-11 retirement, and narrows existing entries to the inputs the gateway accepts.
@github-actions github-actions Bot removed the reviewer: ready Automated review found no actionable items label Sep 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewer: ready Automated review found no actionable items

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant